﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SimplePoker.Main;

namespace SimplePoker.tests
{
    public class PlayerTestBase
    {
        protected void AssertFolds(PlayerBase player, params int[] ranks)
        {
            AssertAction(player, PlayerAction.FOLD, ranks);
        }

        protected void AssertCalls(PlayerBase player, params int[] cardRanks)
        {
            AssertAction(player, PlayerAction.CALL, cardRanks);
        }

        protected void AssertBets(PlayerBase player, params int[] cardRanks)
        {
            AssertAction(player, PlayerAction.BET, cardRanks);
        }

        protected void AssertAction(PlayerBase player, PlayerAction action, params int[] cardRanks)
        {
            foreach (var rank in cardRanks)
            {
                player.Card = new Card(rank);
                Assert.AreEqual<PlayerAction>(action, player.GetAction());
            }
        }
    }
}
